{"ast":null,"code":"import _defineProperty from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/defineProperty.js\";\nimport _slicedToArray from \"/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/@babel/runtime/helpers/esm/slicedToArray.js\";\nimport _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) {\n    if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  }\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Checkbox from './Checkbox';\nimport useStyle from './style';\nexport var GroupContext = /*#__PURE__*/React.createContext(null);\nvar InternalCheckboxGroup = function InternalCheckboxGroup(_a, ref) {\n  var defaultValue = _a.defaultValue,\n    children = _a.children,\n    _a$options = _a.options,\n    options = _a$options === void 0 ? [] : _a$options,\n    customizePrefixCls = _a.prefixCls,\n    className = _a.className,\n    style = _a.style,\n    onChange = _a.onChange,\n    restProps = __rest(_a, [\"defaultValue\", \"children\", \"options\", \"prefixCls\", \"className\", \"style\", \"onChange\"]);\n  var _React$useContext = React.useContext(ConfigContext),\n    getPrefixCls = _React$useContext.getPrefixCls,\n    direction = _React$useContext.direction;\n  var _React$useState = React.useState(restProps.value || defaultValue || []),\n    _React$useState2 = _slicedToArray(_React$useState, 2),\n    value = _React$useState2[0],\n    setValue = _React$useState2[1];\n  var _React$useState3 = React.useState([]),\n    _React$useState4 = _slicedToArray(_React$useState3, 2),\n    registeredValues = _React$useState4[0],\n    setRegisteredValues = _React$useState4[1];\n  React.useEffect(function () {\n    if ('value' in restProps) {\n      setValue(restProps.value || []);\n    }\n  }, [restProps.value]);\n  var getOptions = function getOptions() {\n    return options.map(function (option) {\n      if (typeof option === 'string' || typeof option === 'number') {\n        return {\n          label: option,\n          value: option\n        };\n      }\n      return option;\n    });\n  };\n  var cancelValue = function cancelValue(val) {\n    setRegisteredValues(function (prevValues) {\n      return prevValues.filter(function (v) {\n        return v !== val;\n      });\n    });\n  };\n  var registerValue = function registerValue(val) {\n    setRegisteredValues(function (prevValues) {\n      return [].concat(_toConsumableArray(prevValues), [val]);\n    });\n  };\n  var toggleOption = function toggleOption(option) {\n    var optionIndex = value.indexOf(option.value);\n    var newValue = _toConsumableArray(value);\n    if (optionIndex === -1) {\n      newValue.push(option.value);\n    } else {\n      newValue.splice(optionIndex, 1);\n    }\n    if (!('value' in restProps)) {\n      setValue(newValue);\n    }\n    var opts = getOptions();\n    onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(function (val) {\n      return registeredValues.includes(val);\n    }).sort(function (a, b) {\n      var indexA = opts.findIndex(function (opt) {\n        return opt.value === a;\n      });\n      var indexB = opts.findIndex(function (opt) {\n        return opt.value === b;\n      });\n      return indexA - indexB;\n    }));\n  };\n  var prefixCls = getPrefixCls('checkbox', customizePrefixCls);\n  var groupPrefixCls = \"\".concat(prefixCls, \"-group\");\n  var _useStyle = useStyle(prefixCls),\n    _useStyle2 = _slicedToArray(_useStyle, 2),\n    wrapSSR = _useStyle2[0],\n    hashId = _useStyle2[1];\n  var domProps = omit(restProps, ['value', 'disabled']);\n  if (options && options.length > 0) {\n    children = getOptions().map(function (option) {\n      return /*#__PURE__*/React.createElement(Checkbox, {\n        prefixCls: prefixCls,\n        key: option.value.toString(),\n        disabled: 'disabled' in option ? option.disabled : restProps.disabled,\n        value: option.value,\n        checked: value.includes(option.value),\n        onChange: option.onChange,\n        className: \"\".concat(groupPrefixCls, \"-item\"),\n        style: option.style\n      }, option.label);\n    });\n  }\n  // eslint-disable-next-line react/jsx-no-constructed-context-values\n  var context = {\n    toggleOption: toggleOption,\n    value: value,\n    disabled: restProps.disabled,\n    name: restProps.name,\n    // https://github.com/ant-design/ant-design/issues/16376\n    registerValue: registerValue,\n    cancelValue: cancelValue\n  };\n  var classString = classNames(groupPrefixCls, _defineProperty({}, \"\".concat(groupPrefixCls, \"-rtl\"), direction === 'rtl'), className, hashId);\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", Object.assign({\n    className: classString,\n    style: style\n  }, domProps, {\n    ref: ref\n  }), /*#__PURE__*/React.createElement(GroupContext.Provider, {\n    value: context\n  }, children)));\n};\nvar CheckboxGroup = /*#__PURE__*/React.forwardRef(InternalCheckboxGroup);\nexport default /*#__PURE__*/React.memo(CheckboxGroup);","map":{"version":3,"names":["_toConsumableArray","__rest","s","e","t","p","Object","prototype","hasOwnProperty","call","indexOf","getOwnPropertySymbols","i","length","propertyIsEnumerable","classNames","omit","React","ConfigContext","Checkbox","useStyle","GroupContext","createContext","InternalCheckboxGroup","_a","ref","defaultValue","children","options","customizePrefixCls","prefixCls","className","style","onChange","restProps","useContext","getPrefixCls","direction","useState","value","setValue","registeredValues","setRegisteredValues","useEffect","getOptions","map","option","label","cancelValue","val","prevValues","filter","v","registerValue","concat","toggleOption","optionIndex","newValue","push","splice","opts","includes","sort","a","b","indexA","findIndex","opt","indexB","groupPrefixCls","wrapSSR","hashId","domProps","createElement","key","toString","disabled","checked","context","name","classString","assign","Provider","CheckboxGroup","forwardRef","memo"],"sources":["/Users/poppie/Desktop/development/messenger/app/frontend/node_modules/antd/es/checkbox/Group.js"],"sourcesContent":["import _toConsumableArray from \"@babel/runtime/helpers/esm/toConsumableArray\";\nvar __rest = this && this.__rest || function (s, e) {\n  var t = {};\n  for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n  if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n    if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n  }\n  return t;\n};\nimport classNames from 'classnames';\nimport omit from \"rc-util/es/omit\";\nimport * as React from 'react';\nimport { ConfigContext } from '../config-provider';\nimport Checkbox from './Checkbox';\nimport useStyle from './style';\nexport const GroupContext = /*#__PURE__*/React.createContext(null);\nconst InternalCheckboxGroup = (_a, ref) => {\n  var {\n      defaultValue,\n      children,\n      options = [],\n      prefixCls: customizePrefixCls,\n      className,\n      style,\n      onChange\n    } = _a,\n    restProps = __rest(_a, [\"defaultValue\", \"children\", \"options\", \"prefixCls\", \"className\", \"style\", \"onChange\"]);\n  const {\n    getPrefixCls,\n    direction\n  } = React.useContext(ConfigContext);\n  const [value, setValue] = React.useState(restProps.value || defaultValue || []);\n  const [registeredValues, setRegisteredValues] = React.useState([]);\n  React.useEffect(() => {\n    if ('value' in restProps) {\n      setValue(restProps.value || []);\n    }\n  }, [restProps.value]);\n  const getOptions = () => options.map(option => {\n    if (typeof option === 'string' || typeof option === 'number') {\n      return {\n        label: option,\n        value: option\n      };\n    }\n    return option;\n  });\n  const cancelValue = val => {\n    setRegisteredValues(prevValues => prevValues.filter(v => v !== val));\n  };\n  const registerValue = val => {\n    setRegisteredValues(prevValues => [].concat(_toConsumableArray(prevValues), [val]));\n  };\n  const toggleOption = option => {\n    const optionIndex = value.indexOf(option.value);\n    const newValue = _toConsumableArray(value);\n    if (optionIndex === -1) {\n      newValue.push(option.value);\n    } else {\n      newValue.splice(optionIndex, 1);\n    }\n    if (!('value' in restProps)) {\n      setValue(newValue);\n    }\n    const opts = getOptions();\n    onChange === null || onChange === void 0 ? void 0 : onChange(newValue.filter(val => registeredValues.includes(val)).sort((a, b) => {\n      const indexA = opts.findIndex(opt => opt.value === a);\n      const indexB = opts.findIndex(opt => opt.value === b);\n      return indexA - indexB;\n    }));\n  };\n  const prefixCls = getPrefixCls('checkbox', customizePrefixCls);\n  const groupPrefixCls = `${prefixCls}-group`;\n  const [wrapSSR, hashId] = useStyle(prefixCls);\n  const domProps = omit(restProps, ['value', 'disabled']);\n  if (options && options.length > 0) {\n    children = getOptions().map(option => /*#__PURE__*/React.createElement(Checkbox, {\n      prefixCls: prefixCls,\n      key: option.value.toString(),\n      disabled: 'disabled' in option ? option.disabled : restProps.disabled,\n      value: option.value,\n      checked: value.includes(option.value),\n      onChange: option.onChange,\n      className: `${groupPrefixCls}-item`,\n      style: option.style\n    }, option.label));\n  }\n  // eslint-disable-next-line react/jsx-no-constructed-context-values\n  const context = {\n    toggleOption,\n    value,\n    disabled: restProps.disabled,\n    name: restProps.name,\n    // https://github.com/ant-design/ant-design/issues/16376\n    registerValue,\n    cancelValue\n  };\n  const classString = classNames(groupPrefixCls, {\n    [`${groupPrefixCls}-rtl`]: direction === 'rtl'\n  }, className, hashId);\n  return wrapSSR( /*#__PURE__*/React.createElement(\"div\", Object.assign({\n    className: classString,\n    style: style\n  }, domProps, {\n    ref: ref\n  }), /*#__PURE__*/React.createElement(GroupContext.Provider, {\n    value: context\n  }, children)));\n};\nconst CheckboxGroup = /*#__PURE__*/React.forwardRef(InternalCheckboxGroup);\nexport default /*#__PURE__*/React.memo(CheckboxGroup);"],"mappings":";;AAAA,OAAOA,kBAAkB,MAAM,8CAA8C;AAC7E,IAAIC,MAAM,GAAG,IAAI,IAAI,IAAI,CAACA,MAAM,IAAI,UAAUC,CAAC,EAAEC,CAAC,EAAE;EAClD,IAAIC,CAAC,GAAG,CAAC,CAAC;EACV,KAAK,IAAIC,CAAC,IAAIH,CAAC;IAAE,IAAII,MAAM,CAACC,SAAS,CAACC,cAAc,CAACC,IAAI,CAACP,CAAC,EAAEG,CAAC,CAAC,IAAIF,CAAC,CAACO,OAAO,CAACL,CAAC,CAAC,GAAG,CAAC,EAAED,CAAC,CAACC,CAAC,CAAC,GAAGH,CAAC,CAACG,CAAC,CAAC;EAAC;EACjG,IAAIH,CAAC,IAAI,IAAI,IAAI,OAAOI,MAAM,CAACK,qBAAqB,KAAK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